/*
package com.gulimall.member.controller.mq;

import com.mq.common.rabbitmq.dto.OrderCreatedDTO;
import com.mq.common.rabbitmq.dto.UserRechargeDTO;
import com.mq.common.rabbitmq.enums.ExchangeEnum;
import com.mq.common.rabbitmq.enums.TopicEnum;
import com.mq.common.rabbitmq.service.QueueMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;

*/
/**
 * mq 发消息
 *//*

@RestController
public class SendMessageController {
    */
/**
     * 消息队列发送业务逻辑
     *//*

    @Autowired
    private QueueMessageService queueMessageService;

    */
/**
     * 创建用户MQ生产者
     * @return
     * @throws Exception
     *//*

    @GetMapping("/randomCreateUser")
    public String randomCreateUserWeb() throws Exception {
        return randomCreateUser();
    }

    */
/**
     * 订单创建成功 MQ生产者
     * @param name
     * @param price
     * @return
     * @throws Exception
     *//*

    @GetMapping("/orderCreate/{name}/{price}")
    public OrderCreatedDTO orderCreate(
            @PathVariable(value = "name") String name,
            @PathVariable(value = "price") BigDecimal price
    ) throws Exception {
        String userId = UUID.randomUUID().toString();
        OrderCreatedDTO dto = new OrderCreatedDTO();
        dto.setId(System.currentTimeMillis());
        dto.setBuyTime(new Date());
        dto.setName(name);
        dto.setPrice(price);
        dto.setUserId(userId);
        //发送消息到rabbitmq服务端
        queueMessageService.send(dto, ExchangeEnum.ORDER_CREATE_TOPIC_EXCHANGE, TopicEnum.ORDER_CREATE.getTopicRouteKey());
        return dto;
    }

    */
/**
     * 用户充值 MQ生产者
     * @param amount
     * @return
     * @throws Exception
     *//*

    @GetMapping("/userRecharge/{amount}")
    public UserRechargeDTO userRecharge(
            @PathVariable(value = "amount") BigDecimal amount
    ) throws Exception {
        String userId = UUID.randomUUID().toString();
        UserRechargeDTO dto = new UserRechargeDTO();
        dto.setId(System.currentTimeMillis());
        dto.setRechargeTime(new Date());
        dto.setBankName("中国工商银行");
        dto.setAmount(amount);
        dto.setUserId(userId);
        //发送消息到rabbitmq服务端
        queueMessageService.send(dto, ExchangeEnum.RECHARGE_CREATE_TOPIC_EXCHANGE, TopicEnum.RECHARGE_CREATE.getTopicRouteKey());
        return dto;
    }


    */
/**
     * 随机创建用户
     * 随机生成用户uuid编号，发送到消息队列服务端
     *
     * @return
     * @throws Exception
     *//*

    public String randomCreateUser() throws Exception {
        //用户编号
        String userId = UUID.randomUUID().toString();
        //发送消息到rabbitmq服务端
        queueMessageService.send(userId, ExchangeEnum.USER_REGISTER_TOPIC_EXCHANGE, TopicEnum.USER_REGISTER.getTopicRouteKey());
        return userId;
    }
}*/
